package cn.com.shopec.erp.product.dao.impl;

import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import cn.com.shopec.erp.common.orm.impl.HibernateEntityDao;
import cn.com.shopec.erp.product.dao.ICatBrandDao;
import cn.com.shopec.erp.product.entity.CatBrand;


/**
 * @ClassName: CatBrandDaoImpl
 * @Description: 商品分类与品牌关系dao接口实现
 * @author: gaoyaxiong
 * @date: 2013-5-30 下午14:14:13
 */
@Repository
public class CatBrandDaoImpl extends HibernateEntityDao<CatBrand> implements ICatBrandDao {

	@Override
	public void delectCatBrandByCatNo(String catNo) {
		try {
			Query query = this.createSQLQuery("delete from TBL_CAT_BRAND where cat_no='" + catNo + "'");
			query.executeUpdate();
		} catch (HibernateException e) {
			e.printStackTrace();
		}
	}

	@Override
	public void delectCatBrandByBrandNo(String brandNo) {
		try {
			Query query = this.createSQLQuery("delete from TBL_CAT_BRAND where brand_no='" + brandNo + "'");
			query.executeUpdate();
		} catch (HibernateException e) {
			e.printStackTrace();
		}
	}

}
